package com.yjd.pub.bank.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.bank.model.BankHistoryModel;
import com.yjd.comm.bank.service.IBankHistoryService;
import com.yjd.pub.bank.dao.IBankHistoryDao;

/**
 * <b>description</b>：用户银行卡历史纪录业务实现<br>
 * <b>time</b>：2018-02-02 11:43:59 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
@Service("bankHistoryService")
public class BankHistoryServiceImpl extends BaseServiceImpl implements IBankHistoryService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public BankHistoryModel insert(BankHistoryModel model) throws Exception {
		return this.bankHistoryDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(BankHistoryModel model) throws Exception {
		return this.bankHistoryDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param user_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long user_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("user_id", user_id);
		return this.bankHistoryDao.deleteModel(paramMap, true);
	}

	@Resource
	private IBankHistoryDao bankHistoryDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.bankHistoryDao;
	}

}
